package com.gxkj.drm.uitls;

import javax.management.MalformedObjectNameException;
import javax.management.ObjectName;

public class ObjectNameUtil {

    public static String getObjectNameStr(Class<?> clz) {
        return clz.getPackage().getName() + ":type=" + clz.getSimpleName();
    }

    public static ObjectName getObjectName(Class<?> clz) throws MalformedObjectNameException, NullPointerException {
        return ObjectName.getInstance(getObjectNameStr(clz));
    }

    public static ObjectName getObjectName(String resourcePath) throws MalformedObjectNameException,
            NullPointerException {
        return ObjectName.getInstance(resourcePath);
    }
}
